/*
 *
 * Copyright (c) 2023 - future
 * @author fzh
 * @email e_341877120_mail@163.com
 * @link https://mvnrepository.com/search?q=io.github.xrfzh.cn
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package cn.xrfzh.system.service;

import cn.xrfzh.system.common.base.MyService;
import cn.xrfzh.system.entity.user.AdminMenuVo;
import cn.xrfzh.system.entity.user.AssociatedRoleDto;
import cn.xrfzh.system.entity.user.PasswordDto;
import cn.xrfzh.system.entity.user.User;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 总后台用户表(User)表服务接口
 */
public interface UserService extends MyService<User> {

	/**
	 * 获取当前登录用户的id与用户名
	 * @return Map<String, Object>
	 */
	Map<String, Object> getUserInfo();

	/**
	 * 修改当前登录人密码
	 * @param passwordDTO
	 * @return
	 */
	boolean setPassword(PasswordDto passwordDTO);

	/**
	 * 用户指定角色
	 * @param associatedRoleDTO
	 * @return
	 */
	boolean associatedRole(AssociatedRoleDto associatedRoleDTO);

	/**
	 * 启禁用账户
	 * @param accountId
	 * @return
	 */
	boolean disOrEnaAccount(Long accountId);

	/**
	 * 获取当前登录人菜单
	 * @return
	 */
	List<AdminMenuVo> getMenuList();

	/**
	 * 新增数据
	 * @param user
	 * @return
	 */
	boolean insert(User user);

	/**
	 * 修改数据
	 * @param user
	 * @return
	 */
	boolean update(User user);

	/**
	 * 批量设置内置账户
	 * @param idList
	 * @return
	 */
	boolean setInitAccount(List<Long> idList);

	/**
	 * 获取验证码
	 * @param response
	 */
	void getVerification(HttpServletResponse response);

	/**
	 * 通过userId 获取权限code
	 * @param id
	 * @return
	 */
	List<String> roleCodeByUserId(Long id);

}
